//
//  ViewController.m
//  UISliderAnimation
//
//  Created by ShiMac on 15/5/22.
//  Copyright (c) 2015年 guoyan. All rights reserved.
//

#import "ViewController.h"
#import "UIPopView.h"
#import "UICustomSlider.h"





@interface ViewController ()
{

    UIPopView *view_;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    

    
    UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(40, 70, 80, 30)];
    [btn setTitle:@"click" forState:UIControlStateNormal];
    btn.tag=1;
    btn.backgroundColor=[UIColor cyanColor];
    
    [btn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn];
    
    UICustomSlider *slider=[[UICustomSlider alloc]initWithFrame:CGRectMake(100, 200, 200, 39)];
    [slider setMinimumTrackTintColor:[UIColor blackColor]];
    [slider setMaximumTrackTintColor:[UIColor orangeColor]];
    
    
    [self.view addSubview:slider ];
    
    
    
}

-(void)click:(UIButton *)sender
{
    if (sender.tag==1) {
        
        
        [view_ showAnimation];
        sender.tag=0;
    }else{
        
        [view_ hideAnimation];
        sender.tag=1;
    }
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
